package cn.seaboot.admin.security.jwt;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * JWT参数配置
 *
 * @author Mr.css
 * @version 2019/12/7 17:10
 */
@Component
@ConfigurationProperties(prefix = "boot-security-jwt")
public class SecurityJwtProperties {

    /**
     * 是否使用Session
     */
    private boolean usingSession;

    /**
     * token名称
     */
    private String tokenName = "Authentication";

    /**
     * 密钥
     */
    private String secretKey = "this is a secret key!";
    /**
     * token有效期
     */
    private long timeoutMs = 1800000;
    /**
     * 开启调试模式，开放接口权限
     */
    private boolean debug;
    /**
     * 测试账号
     */
    private String username;

    public boolean isUsingSession() {
        return usingSession;
    }

    public void setUsingSession(boolean usingSession) {
        this.usingSession = usingSession;
    }

    public String getTokenName() {
        return tokenName;
    }

    public void setTokenName(String tokenName) {
        this.tokenName = tokenName;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public long getTimeoutMs() {
        return timeoutMs;
    }

    public void setTimeoutMs(long timeoutMs) {
        this.timeoutMs = timeoutMs;
    }

    public boolean isDebug() {
        return debug;
    }

    public void setDebug(boolean debug) {
        this.debug = debug;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "SecurityJwtConstant{" +
                "usingSession=" + usingSession +
                ", tokenName='" + tokenName + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", timeoutMs=" + timeoutMs +
                ", debug=" + debug +
                ", username='" + username + '\'' +
                '}';
    }
}
